<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: shanpengfei
  Date: 2019/2/28
  Time: 5:58 PM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<c:set var="basePath" value="/gyp"></c:set>

<jsp:include page="../template_header.jsp"></jsp:include>

<div class="list-content">
    <c:forEach items="${page.list}" var="list">
        <div class="list-item fl">
            <img src="${list.pic}" width="240" height="240">

            <div class="item-text" title="${list.type==1?'雕刻':list.type==2?'瓷器':list.type==3?'编制品':'其他'}">教程类型：${list.type==1?'雕刻':list.type==2?'瓷器':list.type==3?'编制品':'其他'}</div>
            <div class="item-text" title="${list.title}">教程标题：${list.title}</div>

            <ul class="item-text">
                <li class="item-text-item fl"><a href="${basePath}/teach/show/${list.id}">教程详情</a></li>
                <c:if test="${sessionScope.user.username=='admin'}">
                    <li class="item-text-item fl"><a href="${basePath}/teach/update/${list.id}">教程修改</a></li>
                    <li class="item-text-item fl"><a href="${basePath}/teach/del/${list.id}">教程下架</a></li>
                </c:if>
                <li class="clear"></li>
            </ul>
        </div>
    </c:forEach>
    <div class="clear"></div>
</div>

<ul class="list-page">
    <c:if test="${!page.isFirstPage}">
        <li class="fl"><a href="${basePath}/teach/1?type=${param.type}&province=${param.province}&nation=${param.nation}&name=${param.name}">首页</a></li>
    </c:if>
    <c:if test="${page.hasPreviousPage}">
        <li class="fl"><a href="${basePath}/teach/${page.pageNum-1}?type=${param.type}&province=${param.province}&nation=${param.nation}&name=${param.name}">上一页</a></li>
    </c:if>
    <span class="fl">${page.pageNum}</span>
    <c:if test="${page.hasNextPage}">
        <li class="fl"><a href="${basePath}/teach/${page.pageNum+1}?type=${param.type}&province=${param.province}&nation=${param.nation}&name=${param.name}">下一页</a></li>
    </c:if>
    <c:if test="${!page.isLastPage}">
        <li class="fl"><a href="${basePath}/teach/${page.pages}?type=${param.type}&province=${param.province}&nation=${param.nation}&name=${param.name}">尾页</a></li>
    </c:if>
    <li class="clear"></li>
</ul>

<jsp:include page="../template_footer.jsp"></jsp:include>
